import server from './server';

//合约交易
export const getPro = (data) => { //行情列表
    return server.get('/contract/symbols',
        {
            params: data
        })
}

export const createOrder = (data) => { //合约交易下单
    return server.post('/contract/create_order', data)
}

export const setPoit = (data) => { //设置止盈止损
    return server.post('/contract/set_point', data)
}
export const cancellations = (data) => { //委托撤单
    return server.post('/contract/revoke_order', data)
}
export const bcancellations = (data) => { //bb撤单
    return server.post('/exchange/revoke_order', data)
}
export const closePosition = (data) => { //平仓（单个）
    return server.post('/contract/close_position', data)
}
export const allClosePosition = (data) => { //一键全平
    return server.post('/contract/close_all', data)
}
export const transData = (data) => { //持仓/委托
    return server.get('/contract/trans_data',
        {
            params: data
        })
}

export const orderList = (data) => { //成交订单
    return server.get('/contract/order_list',
        {
            params: data
        })
}

export const statistics = (data) => { //持仓信息
    return server.get('/contract/statistics',
        {
            params: data
        })
}

export const codeinfo = (data) => { //可用+杠杆+风险率  获取币种配置信息
    return server.get('/contract/code_info',
        {
            params: data
        })
}

export const getProduct = (data) => { //交易信息 爆仓率等
    return server.get('/contract/info',
        {
            params: data
        })
}

export const gethandicap = (data) => { //获取币种盘口
    return server.get('/contract/depth',
        {
            params: data
        })
}
export const realtimetrade = (data) => { //实时成交
    return server.get('/contract/trader',
        {
            params: data
        })
}